package com.xjtu.platform.respondent.respond.impl;

import com.xjtu.platform.common.CurrentUser;
import com.xjtu.platform.common.Utils;
import com.xjtu.platform.respondent.respond.RespondDto;
import com.xjtu.platform.respondent.respond.RespondService;
import com.xjtu.platform.respondent.respond.dao.RespondDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

@Service
@Transactional
public class RespondServiceImpl implements RespondService {
    @Resource
    private RespondDao respondDao;

    @Override
    public Map<String, Object> getRespondList(CurrentUser currentUser ) {
        return Utils.getPage(currentUser ,()->respondDao.findRespondList(currentUser));
    }

    @Override
    public void updateInfo(RespondDto dto) {
        respondDao.setinfo(dto);
    }
}
